//
//  ZTIMSetUserDefaultTool.m
//  AFNetworking
//
//  Created by 武得亮 on 2021/3/12.
//

#import "ZTIMSetUserDefaultTool.h"

#define USERDEFAULT [NSUserDefaults standardUserDefaults]
#define FONT_COEFFICIENT @"IMSizeFontCoefficient"

@implementation ZTIMSetUserDefaultTool


+(void)setFontSizeCoefficient:(NSInteger )coefficient{
    [USERDEFAULT setInteger:coefficient forKey:FONT_COEFFICIENT];
}

+ (void)removeFontSizeCoefficient{
    [USERDEFAULT removeObjectForKey:FONT_COEFFICIENT];
}

+(NSInteger)getFontSizeCoefficient{
    
    NSInteger coefficient = [USERDEFAULT integerForKey:FONT_COEFFICIENT];
    if (coefficient==0) {//返回默认2
        return 2;
    }
    return  coefficient;
}

+(float )getScaleCoefficient{
    
    NSInteger coefficient =[ZTIMSetUserDefaultTool getFontSizeCoefficient];
    return 0.075*(coefficient-2)+1;
}

@end
